﻿<Activity mc:Ignorable="sads sap" x:Class="ERPStore.Exporter.Workflows.GenerateCatalogs" this:GenerateCatalogs.PageSize="100"
 xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities"
 xmlns:eem="clr-namespace:ERPStore.Exporter.Models;assembly=ERPStore.Exporter.Models"
 xmlns:em="clr-namespace:ERPStore.Models;assembly=ERPStore.Core"
 xmlns:em1="clr-namespace:ERPStore.Models;assembly=ERPStore.Models"
 xmlns:local="clr-namespace:ERPStore.Exporter.Providers"
 xmlns:local1="clr-namespace:ERPStore.Exporter.Workflows.Activities"
 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
 xmlns:mv="clr-namespace:Microsoft.VisualBasic;assembly=System"
 xmlns:mva="clr-namespace:Microsoft.VisualBasic.Activities;assembly=System.Activities"
 xmlns:s="clr-namespace:System;assembly=mscorlib"
 xmlns:s1="clr-namespace:System;assembly=System"
 xmlns:s2="clr-namespace:System;assembly=System.Xml"
 xmlns:s3="clr-namespace:System;assembly=System.Core"
 xmlns:s4="clr-namespace:System;assembly=ERPStore.Core"
 xmlns:s5="clr-namespace:System;assembly=System.ServiceModel"
 xmlns:sa="clr-namespace:System.Activities;assembly=System.Activities"
 xmlns:sad="clr-namespace:System.Activities.Debugger;assembly=System.Activities"
 xmlns:sads="http://schemas.microsoft.com/netfx/2010/xaml/activities/debugger"
 xmlns:sap="http://schemas.microsoft.com/netfx/2009/xaml/activities/presentation"
 xmlns:scg="clr-namespace:System.Collections.Generic;assembly=mscorlib"
 xmlns:scg1="clr-namespace:System.Collections.Generic;assembly=System"
 xmlns:scg2="clr-namespace:System.Collections.Generic;assembly=System.ServiceModel"
 xmlns:scg3="clr-namespace:System.Collections.Generic;assembly=System.Core"
 xmlns:sd="clr-namespace:System.Data;assembly=System.Data"
 xmlns:sl="clr-namespace:System.Linq;assembly=System.Core"
 xmlns:st="clr-namespace:System.Text;assembly=mscorlib"
 xmlns:this="clr-namespace:ERPStore.Exporter.Workflows"
 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  <x:Members>
    <x:Property Name="ExportList" Type="InArgument(scg:List(local:IExport))" />
    <x:Property Name="ForceExport" Type="InArgument(x:Boolean)" />
    <x:Property Name="PageSize" Type="InArgument(x:Int32)" />
  </x:Members>
  <sap:VirtualizedContainerService.HintSize>628,2870</sap:VirtualizedContainerService.HintSize>
  <mva:VisualBasic.Settings>Assembly references and imported namespaces for internal implementation</mva:VisualBasic.Settings>
  <Sequence DisplayName="MainSequence" sad:XamlDebuggerXmlReader.FileName="E:\S2\ERPStore.Core\trunk\plugins\Exporters\ERPStore.Exporter\Workflows\GenerateCatalogs.xaml" sap:VirtualizedContainerService.HintSize="588,2830">
    <Sequence.Variables>
      <Variable x:TypeArguments="x:Boolean" Name="ExportExists" />
      <Variable x:TypeArguments="em1:LeadSourceBase" Name="LeadSource" />
      <Variable x:TypeArguments="x:Int32" Name="PageIndex" />
      <Variable x:TypeArguments="scg:List(em1:Product)" Name="ProductList" />
      <Variable x:TypeArguments="scg:List(em1:ProductStockInfo)" Name="ProductStockInfoList" />
      <Variable x:TypeArguments="st:StringBuilder" Name="Document" />
      <Variable x:TypeArguments="x:Boolean" Default="False" Name="NoMoreProduct" />
      <Variable x:TypeArguments="scg:List(x:Int32)" Name="BanishedProductList" />
    </Sequence.Variables>
    <sap:WorkflowViewStateService.ViewState>
      <scg:Dictionary x:TypeArguments="x:String, x:Object">
        <x:Boolean x:Key="IsExpanded">True</x:Boolean>
      </scg:Dictionary>
    </sap:WorkflowViewStateService.ViewState>
    <ForEach x:TypeArguments="local:IExport" DisplayName="ForEach&lt;IExport&gt;" sap:VirtualizedContainerService.HintSize="566,502" Values="[ExportList]">
      <ActivityAction x:TypeArguments="local:IExport">
        <ActivityAction.Argument>
          <DelegateInArgument x:TypeArguments="local:IExport" Name="export" />
        </ActivityAction.Argument>
        <Sequence sap:VirtualizedContainerService.HintSize="486,394">
          <sap:WorkflowViewStateService.ViewState>
            <scg:Dictionary x:TypeArguments="x:String, x:Object">
              <x:Boolean x:Key="IsExpanded">True</x:Boolean>
            </scg:Dictionary>
          </sap:WorkflowViewStateService.ViewState>
          <local1:CheckExportFileExists ExportExists="[ExportExists]" FileName="[export.Settings.FileName]" Force="[ForceExport]" sap:VirtualizedContainerService.HintSize="464,22" />
          <If Condition="[ExportExists = False Or ForceExport = True]" sap:VirtualizedContainerService.HintSize="464,208">
            <If.Else>
              <RemoveFromCollection x:TypeArguments="local:IExport" Collection="[ExportList]" DisplayName="RemoveFromCollection&lt;IExport&gt;" sap:VirtualizedContainerService.HintSize="200,22" Item="[export]" />
            </If.Else>
          </If>
        </Sequence>
      </ActivityAction>
    </ForEach>
    <ForEach x:TypeArguments="local:IExport" DisplayName="ForEach&lt;IExport&gt;" sap:VirtualizedContainerService.HintSize="566,316" Values="[ExportList]">
      <ActivityAction x:TypeArguments="local:IExport">
        <ActivityAction.Argument>
          <DelegateInArgument x:TypeArguments="local:IExport" Name="item" />
        </ActivityAction.Argument>
        <Sequence sap:VirtualizedContainerService.HintSize="222,208">
          <sap:WorkflowViewStateService.ViewState>
            <scg:Dictionary x:TypeArguments="x:String, x:Object">
              <x:Boolean x:Key="IsExpanded">True</x:Boolean>
            </scg:Dictionary>
          </sap:WorkflowViewStateService.ViewState>
          <local1:GetBanishedProductList ExportArgument="[item]" sap:VirtualizedContainerService.HintSize="200,22" />
          <local1:CreateDocument ExportArgument="[item]" sap:VirtualizedContainerService.HintSize="200,22" />
        </Sequence>
      </ActivityAction>
    </ForEach>
    <DoWhile sap:VirtualizedContainerService.HintSize="566,1514" Condition="[NoMoreProduct = True]">
      <Sequence sap:VirtualizedContainerService.HintSize="540,1392">
        <sap:WorkflowViewStateService.ViewState>
          <scg:Dictionary x:TypeArguments="x:String, x:Object">
            <x:Boolean x:Key="IsExpanded">True</x:Boolean>
          </scg:Dictionary>
        </sap:WorkflowViewStateService.ViewState>
        <local1:GetPagedProductList ProductCountTotal="{x:Null}" sap:VirtualizedContainerService.HintSize="518,22" NoMoreProduct="[NoMoreProduct]" PageIndex="[PageIndex]" PageSize="[PageSize]" ProductList="[ProductList]" />
        <ForEach x:TypeArguments="em1:Product" DisplayName="ForEach&lt;Product&gt;" sap:VirtualizedContainerService.HintSize="518,208" Values="[ProductList]">
          <ActivityAction x:TypeArguments="em1:Product">
            <ActivityAction.Argument>
              <DelegateInArgument x:TypeArguments="em1:Product" Name="item" />
            </ActivityAction.Argument>
            <local1:ApplyOffers sap:VirtualizedContainerService.HintSize="200,22" Product="[item]" />
          </ActivityAction>
        </ForEach>
        <local1:GetProductStockList sap:VirtualizedContainerService.HintSize="518,22" ProductList="[ProductList]" ProductStockInfoList="[ProductStockInfoList]" />
        <ForEach x:TypeArguments="local:IExport" DisplayName="ForEach&lt;IExport&gt;" sap:VirtualizedContainerService.HintSize="518,796" Values="[ExportList]">
          <ActivityAction x:TypeArguments="local:IExport">
            <ActivityAction.Argument>
              <DelegateInArgument x:TypeArguments="local:IExport" Name="export" />
            </ActivityAction.Argument>
            <Sequence DisplayName="ExportProductSequence" sap:VirtualizedContainerService.HintSize="488,688">
              <Sequence.Variables>
                <Variable x:TypeArguments="scg:List(em1:Product)" Name="FilteredProductList" />
              </Sequence.Variables>
              <sap:WorkflowViewStateService.ViewState>
                <scg:Dictionary x:TypeArguments="x:String, x:Object">
                  <x:Boolean x:Key="IsExpanded">True</x:Boolean>
                </scg:Dictionary>
              </sap:WorkflowViewStateService.ViewState>
              <local1:ApplyProductFilter BanishedProductList="[export.BanishedProductIdList]" FilteredProductListArgument="[FilteredProductList]" sap:VirtualizedContainerService.HintSize="466,22" ProductList="[ProductList]" ProductStockList="[ProductStockInfoList]" Settings="[export.Settings]" />
              <ForEach x:TypeArguments="em1:Product" DisplayName="ForEach&lt;Product&gt;" sap:VirtualizedContainerService.HintSize="466,502" Values="[FilteredProductList]">
                <ActivityAction x:TypeArguments="em1:Product">
                  <ActivityAction.Argument>
                    <DelegateInArgument x:TypeArguments="em1:Product" Name="product" />
                  </ActivityAction.Argument>
                  <Sequence sap:VirtualizedContainerService.HintSize="436,394">
                    <sap:WorkflowViewStateService.ViewState>
                      <scg:Dictionary x:TypeArguments="x:String, x:Object">
                        <x:Boolean x:Key="IsExpanded">True</x:Boolean>
                      </scg:Dictionary>
                    </sap:WorkflowViewStateService.ViewState>
                    <TryCatch sap:VirtualizedContainerService.HintSize="414,270">
                      <TryCatch.Try>
                        <local1:CreateElement ExportArgument="[export]" sap:VirtualizedContainerService.HintSize="200,22" Product="[product]" ProductStockInfoList="[ProductStockInfoList]" />
                      </TryCatch.Try>
                      <TryCatch.Catches>
                        <Catch x:TypeArguments="s:Exception" sap:VirtualizedContainerService.HintSize="400,108">
                          <sap:WorkflowViewStateService.ViewState>
                            <scg:Dictionary x:TypeArguments="x:String, x:Object">
                              <x:Boolean x:Key="IsExpanded">True</x:Boolean>
                              <x:Boolean x:Key="IsPinned">False</x:Boolean>
                            </scg:Dictionary>
                          </sap:WorkflowViewStateService.ViewState>
                          <ActivityAction x:TypeArguments="s:Exception">
                            <ActivityAction.Argument>
                              <DelegateInArgument x:TypeArguments="s:Exception" Name="exception" />
                            </ActivityAction.Argument>
                            <local1:ProductExceptionLogger ExceptionArgument="[exception]" sap:VirtualizedContainerService.HintSize="200,22" ProductArgument="[product]" />
                          </ActivityAction>
                        </Catch>
                      </TryCatch.Catches>
                    </TryCatch>
                  </Sequence>
                </ActivityAction>
              </ForEach>
            </Sequence>
          </ActivityAction>
        </ForEach>
        <Assign sap:VirtualizedContainerService.HintSize="518,60">
          <Assign.To>
            <OutArgument x:TypeArguments="x:Int32">[PageIndex]</OutArgument>
          </Assign.To>
          <Assign.Value>
            <InArgument x:TypeArguments="x:Int32">[PageIndex + 1]</InArgument>
          </Assign.Value>
        </Assign>
      </Sequence>
    </DoWhile>
    <ForEach x:TypeArguments="local:IExport" DisplayName="ForEach&lt;IExport&gt;" sap:VirtualizedContainerService.HintSize="516,254" Values="[ExportList]">
      <ActivityAction x:TypeArguments="local:IExport">
        <ActivityAction.Argument>
          <DelegateInArgument x:TypeArguments="local:IExport" Name="item" />
        </ActivityAction.Argument>
        <Sequence sap:VirtualizedContainerService.HintSize="222,146">
          <sap:WorkflowViewStateService.ViewState>
            <scg:Dictionary x:TypeArguments="x:String, x:Object">
              <x:Boolean x:Key="IsExpanded">True</x:Boolean>
            </scg:Dictionary>
          </sap:WorkflowViewStateService.ViewState>
          <local1:SaveDocument ExportArgument="[item]" sap:VirtualizedContainerService.HintSize="200,22" />
        </Sequence>
      </ActivityAction>
    </ForEach>
  </Sequence>
</Activity>